import userCookies from "@/utils/data/cookies";
import store from "@/store";
const userPark = {
    /**
     * @description 设置
     * @param {any} data
     */
    set: function (data) {
        const { yard_sn, yard_name, oa_id } = data;
        userCookies.set(yard_sn, 'yard_sn');
        userCookies.set(yard_name, 'yard_name');
        userCookies.set({ yard_sn, yard_name, oa_id }, 'park', {
            isJson: true
        });
        store.state.sharing.park = data
    },
    /**
      * @description 清空
      *
      */
    remove: function (accessLoad?) {
        userCookies.remove("yard_sn");
        userCookies.remove("yard_name");
        userCookies.remove("park");
        store.state.sharing.park = {};
        if (accessLoad) {
            store.dispatch("coreMenu/accessLoad", true);
        }
    }
}

export default userPark;